package com.ribbon.lcn.servicea.repository;

import com.ribbon.lcn.servicea.entity.Storage;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

/**
 * @InterfaceName StorageRepository
 * @author: Ribbon
 * @Date 2019/3/21 14:22
 **/
public interface StorageRepository extends JpaRepository<Storage,Integer> {
    @Modifying
    @Query("update storage_tbl t1 SET  t1.num = t1.num - ?2 where t1.commodityCode = ?1")
    void calculate(String commodityCode, int orderCount);
}
